package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;
	import flash.net.Socket;

	public class SpykeWidgetConstructorProxy extends SpykeWidgetProxy implements SpykeWidgetConstructor
	{

		public function SpykeWidgetConstructorProxy(remoteeID:int, connection:RemedyClientServerConnection)
		{
			super(remoteeID, connection);
		}

		public function getAvailableWidgets(onReturn:Function/*Vector.<String>*/):void
		{
			connection.performCall(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 70);

			}, new RemedyFunctionSpecification(onReturn, RemedyArrayClassManager.forType(1)));
		}

		public function createNewWidget(a:String, onReturn:Function/*SpykeWidget*/):void
		{
			connection.performCall(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 69);
				RemedyStringClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			}, new RemedyFunctionSpecification(onReturn, RemedyMOClassManager.INSTANCE));
		}
	}
}
